Attribute VB_Name = "modFunctionsUtility"
Option Explicit

Public Sub RicaricaFiltro(tFiltro As structFiltro)
    Dim i As Integer
    stoRicaricando = True
    With tFiltro
        ' imposta l'utente
        If .indexUtente = 0 Then
            ' discolora
            Call ColoraFlx(frmMain.flxUtenti, frmMain.flxUtenti.Cols - 1, vbWhite)
            ' annulla le row e col
            frmMain.flxUtenti.Row = 0
            frmMain.flxUtenti.Col = 0
        Else
            For i = 1 To frmMain.flxUtenti.Rows - 1
                If frmMain.flxUtenti.TextMatrix(i, 0) = .indexUtente Then
                    Exit For
                End If
            Next i
            frmMain.flxUtenti.Row = i
            Call ColoraFlx(frmMain.flxUtenti, frmMain.flxUtenti.Cols - 1)
        End If
        ' imposta la data
        If .dataMin = CDate("0.00.00") Then
            frmMain.lblData(0) = ""
        Else
            frmMain.lblData(0) = .dataMin
        End If
        If .dataMax = CDate("0.00.00") Then
            frmMain.lblData(1) = ""
        Else
            frmMain.lblData(1) = .dataMax
        End If
        ' imposta il chk
        frmMain.chkUnSoloTipo.Value = IIf(.unSoloTipo, Checked, Unchecked)
        If .unSoloTipo Then
            frmMain.cboTipo.ListIndex = .tipo - 1
        Else
            frmMain.cboTipo.ListIndex = -1
        End If
    End With
    stoRicaricando = False
End Sub
